package com.haidechizi.leetcode;

/**
 * @author: wangdejun
 * @create: 2020-04-18 15:46
 **/
public class _11_盛最多水的容器 {

    public int maxArea(int[] height) {
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < height.length; i++) {
            int left = height[i];
            for (int j = i + 1; j < height.length; j++) {
                int right = height[j];
                max = Math.max(max, Math.min(left, right) * (j - i));
            }
        }
        return max;

    }

}
